{include file="public_head" /}



<!-- datatables -->

<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>

<!-- Select2 -->

<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">

<!-- chk_3 -->

<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>



<body class="nav-md">



<div class="container body">





    <div class="main_container">



        {include file="public_sidebar,public_nav" /}



        <!-- page content -->

        <div class="right_col" role="main">

            <div class="">

                <div class="page-title">

                    <div class="title_left">



                    </div>

                </div>

                <div class="clearfix"></div>



                <div class="row">



                    <div class="col-md-12 col-sm-12 col-xs-12">

                        <div class="x_panel">

                            <div class="x_title">

                                <h2>订单管理

                                    <!--<small>promotion</small>-->

                                </h2>

                                <div class="clearfix"></div>

                            </div>

                            <div class="x_content">

                                <form name="form" id="form" method="get" action="">



                                    <div class="title_left">

                                        <div class="col-md-{eq name='$auding_status' value="2"}11{else/}9{/eq} col-sm-3 col-xs-12 form-group pull-left top_search">

                                            <!--<div class="input-group" style="float: left;margin: 0 20px;">-->



                                                <!--<select name="way" class="select2_single" style="width: 200px;"-->

                                                        <!--tabindex="-1">-->

                                                    <!--<option value="0">- 请选择支付状态 -</option>-->

                                                    <!--<option value="未支付" {eq name=':input("way")' value='未支付' }selected{/eq}>未支付</option>-->

                                                    <!--<option value="余额支付" {eq name=':input("way")' value='余额支付' }selected{/eq}>余额支付</option>-->

                                                    <!--<option value="支付宝" {eq name=':input("way")' value='支付宝' }selected{/eq}>支付宝</option>-->

                                                    <!--<option value="微信" {eq name=':input("way")' value='微信' }selected{/eq}>微信</option>-->

                                                    <!--<option value="退款" {eq name=':input("way")' value='退款' }selected{/eq}>退款</option>-->

                                                <!--</select>-->

                                            <!--</div>-->

                                        <div class="input-group" style="float: left;margin: 0 20px;">

                                            <select name="auding_status" class="select2_single" style="width: 140px;"

                                                    tabindex="-1">

                                                <option value="0">- 免费订单审核状态 -</option>

                                                <option value="1" {eq name=':input("auding_status")' value='1' }selected{/eq}>等待审核</option>

                                                <option value="2" {eq name=':input("auding_status")' value='2' }selected{/eq}>已审核</option>

                                                <option value="3" {eq name=':input("auding_status")' value='3' }selected{/eq}>失败</option>

                                            </select>

                                        </div>



                                        <div class="input-group" style="float: left;margin: 0 20px;">

                                            <select name="finance_order" class="select2_single" style="width: 140px;"

                                                    tabindex="-1">

                                                <option value="0">- 绩效订单类型 -</option>

                                                <option value="1" {eq name=':input("finance_order")' value='1' }selected{/eq}>业务员订单</option>

                                                <option value="2" {eq name=':input("finance_order")' value='2' }selected{/eq}>二维码订单</option>

                                                <option value="3" {eq name=':input("finance_order")' value='3' }selected{/eq}>门店订单</option>

                                                <option value="4" {eq name=':input("finance_order")' value='4' }selected{/eq}>普通订单</option>

                                            </select>

                                        </div>

                                        <div class="input-group" style="float: left;margin: 0 20px;">

                                            <select name="order_online" class="select2_single" style="width: 140px;"

                                                    tabindex="-1">

                                                <option value="0">- 线(上/下)订单 -</option>

                                                <option value="1" {eq name=':input("order_online")' value='1' }selected{/eq}>线上订单</option>

                                                <option value="2" {eq name=':input("order_online")' value='2' }selected{/eq}>线下订单</option>

                                            </select>

                                        </div>

                                        <div class="input-group" style="float: left;margin: 0 20px;">



                                            <select name="is_certification" id="status" class="select2_single" style="width: 200px;"

                                                    tabindex="-1">

                                                <option value="0">- 认证状态 -</option>

                                                <option value="1" {eq name=':input("is_certification")' value='1' }selected{/eq}>未认证</option>

                                                <option value="3" {eq name=':input("is_certification")' value='3' }selected{/eq}>等待认证</option>

                                                <option value="2" {eq name=':input("is_certification")' value='2' }selected{/eq}>已认证</option>

                                            </select>

                                        </div>

                                            <div class="input-group" style="float: left;margin: 0 20px;">

                                                <select name="status" id="status" class="select2_single" style="width: 200px;"

                                                        tabindex="-1">

                                                    <option value="0">- 全部订单 -</option>

                                                    <option value="1" {eq name=':input("status")' value='1' }selected{/eq}>未支付</option>

                                                    <option value="2" {eq name=':input("status")' value='2' }selected{/eq}>已支付</option>

                                                    <option value="3" {eq name=':input("status")' value='3' }selected{/eq}>已发货</option>

                                                    <option value="4" {eq name=':input("status")' value='4' }selected{/eq}>已完成</option>

                                                    <option value="5" {eq name=':input("status")' value='5' }selected{/eq}>待评价</option>

                                                    <option value="10" {eq name=':input("status")' value='10' }selected{/eq}>退款中</option>

                                                    <option value="11" {eq name=':input("status")' value='11' }selected{/eq}>退款成功</option>

                                                    <option value="12" {eq name=':input("status")' value='12' }selected{/eq}>退款失败</option>

                                                    <option value="20" {eq name=':input("status")' value='20' }selected{/eq}>取消订单</option>

                                                    <!--<option value="4" {eq name=':input("status")' value='4' }selected{/eq}>已完结</option>-->

                                                    <!--<option value="5" {eq name=':input("status")' value='5' }selected{/eq}>已取消</option>-->

                                                    <!--<option value="6" {eq name=':input("status")' value='6' }selected{/eq}>申请退款</option>-->

                                                    <!--<option value="7" {eq name=':input("status")' value='7' }selected{/eq}>退款成功</option>-->

                                                </select>

                                            </div>



                                            {eq name="$auding_status" value="2"}

                                            <div class="input-group" style="float: left;margin: 0 20px;">



                                                <select name="shop_id" id="status1" class="select2_single1" style="width: 200px;"

                                                        tabindex="-1">

                                                    <option value="0">- 全部门店 -</option>

                                                    {volist name="$shop_list" id="item"}

                                                    <option value="{$item.id}" {eq name=':input("shop_id")' value='$item.id' }selected{/eq}>{$item.shop_title}</option>

                                                    {/volist}

                                                </select>



                                            </div>

                                            {/eq}

                                            <div class="input-group" style="float: left;margin: 0 20px;">

                                                <input type="text" class="form-control" name="interval_timer"

                                                       id="interval_timer"

                                                       style="width: 200px;"

                                                       placeholder="请选择时间区间..." value="{:input('interval_timer')}">

                                            </div>

                                            <div class="input-group">

                                                <input type="text" class="form-control" name="title"

                                                       placeholder="输入搜索内容..." value="{:input('title')}">

                                            </div>

                                        </div>

                                        <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索</button>

                                    </div>



                                    <table class="table table-striped table-bordered">

                                        <thead>

                                        <tr>

                                            <!--<td><input type="checkbox" class="checkall"-->

                                                       <!--onclick="CheckAll(this.checked);"/></td>-->

                                            <th>订 单 号</th>

                                            <!--<th>店铺名称</th>-->

                                            <th>买家账号</th>

                                            <th>商品分类</th>

                                            <th>车牌号</th>

                                            <th>(APP/小程序)</th>

                                            <th>认证状态</th>



                                            <th>绩效订单</th>

                                            <th>(线上/下)订单</th>

                                            <th>(免/付)费订单</th>

                                            <th>下单/退款时间</th>

                                            <th>消费门店</th>

                                            <th>订单总额</th>

                                            <th>配送方式</th>

                                            <th>订单状态</th>

                                            {if condition="strpos('5,7,8,9,10',(string)session('role_id')) !== false"}

                                            <th>消息提醒</th>

                                            {/if}

                                            <th>退款提醒</th>

                                            {eq name=":session('role_id')" value="1"}

                                            <th>是否删除订单</th>

                                            {/eq}

                                            <th>操作</th>

                                        </tr>

                                        </thead>



                                        <tbody>

                                        {empty name="data"}

                                        <tr><td colspan="8"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>

                                        {/empty}

                                        {volist  name="data" id="vo"}

                                        <tr>

                                            <td>{$vo.shop_order_number}</td>



                                            <td>{$vo.username}</td>

                                            <td>{$vo.cat_str}</td>

                                            <td>{$vo.car_number}</td>

                                            <td>

                                                {switch name="$vo.device"}

                                                {case 1}APP{/case}

                                                {case 2}小程序{/case}

                                                {default /}无

                                                {/switch}

                                            </td>

                                            <td>{$vo.is_certification_text}</td>

                                            <td>{$vo.finance_order_text}</td>

                                            <td>{$vo.order_online_text}</td>

                                            <td>{$vo.is_free_order_text}{eq name="$vo.is_free_order" value="2"}({$vo.auding_status_text}){/eq}</td>

                                            <td>{$vo.create_time}{neq name="$vo.refund_create_time" value="0000-00-00 00:00:00"} <br/> {$vo.refund_create_time}{/neq}</td>

                                            <td>{$vo.shop_title}</td>

                                            <td>{$vo.amount}</td>

                                            <td>

                                                {switch name="$vo.shipping"}

                                                {case 1}商家配送{/case}

                                                {case 2}到店自提{/case}

                                                {default /}无

                                                {/switch}

                                            </td>

                                            <td>

                                                {switch name="$vo.status"}

                                                {case 1}未支付{/case}

                                                {case 2}已支付{/case}

                                                {case 3}已发货{/case}

                                                {case 4}已完成{/case}

                                                {case 5}待评价{/case}

                                                {case 10}退款中{/case}

                                                {case 11}退款成功{/case}

                                                {case 20}已取消({$vo.cancel_content}){/case}

                                                {case 12}退款失败{/case}

                                                {/switch}

                                            </td>

                                            {if condition="strpos('5,7,8,9,10',(string)session('role_id')) !== false"}

                                            <td>{eq name=":session('auding_status')" value="2"}

                                                {switch name="$vo.is_read"}

                                                {case 1}-{/case}

                                                {default/}未读

                                                {/switch}

                                                {else/}

                                                {switch name="$vo.is_read_shop"}

                                                {case 1}-{/case}

                                                {default/}未读

                                                {/switch}

                                                {/eq}

                                            </td>

                                            {/if}

                                            <td>

                                                {in name="$vo.status" value="10,11,12"}

                                                {eq name=":session('role_id')" value="5"}

                                                {switch name="$vo.is_read_5"}

                                                {case 1}-{/case}

                                                {default/}{eq name="$vo.refund_button" value="true"}等待处理{else/}{/eq}

                                                {/switch}

                                                {/eq}

                                                {eq name=":session('role_id')" value="7"}

                                                {switch name="$vo.is_read_7"}

                                                {case 1}-{/case}

                                                {default/}{eq name="$vo.refund_button" value="true"}等待处理{else/}{/eq}

                                                {/switch}

                                                {/eq}

                                                {eq name=":session('role_id')" value="8"}

                                                {switch name="$vo.is_read_8"}

                                                {case 1}-{/case}

                                                {default/}{eq name="$vo.refund_button" value="true"}等待处理{else/}{/eq}

                                                {/switch}

                                                {/eq}

                                                {eq name=":session('role_id')" value="9"}

                                                {switch name="$vo.is_read_9"}

                                                {case 1}-{/case}

                                                {default/}{eq name="$vo.refund_button" value="true"}等待处理{else/}{/eq}

                                                {/switch}

                                                {/eq}

                                                {eq name=":session('role_id')" value="10"}

                                                {switch name="$vo.is_read_10"}

                                                {case 1}-{/case}

                                                {default/}{eq name="$vo.refund_button" value="true"}等待处理{else/}{/eq}

                                                {/switch}

                                                {/eq}

                                                {/in}

                                            </td>

                                            {eq name=":session('role_id')" value="1"}

                                            <td>

                                                <input type="checkbox" id="checkbox411_{$vo.id}" class="chk_3"

                                                       value="{$vo.is_delete}" {eq name="$vo['is_delete']" value="1"}checked {/eq} />

                                                <label style="margin-left: 30px;margin-top: 5px;"

                                                       onclick="queren('{:url(\'order\/is_delete\',[\'id\' => $vo[\'id\']])}')"

                                                       for="checkbox4_{$vo.id}"></label>

                                            </td>

                                            {/eq}

                                            <td><a href="{:url('console/order/update', ['id' => $vo['id'],'car_number' => $vo.car_number,'is_certification_text' => $vo.is_certification_text])}"

                                                   class="label label-primary" style="margin-left: 10px;">

                                                <span class="fa fa-pencil"></span>&nbsp;&nbsp;查 看

                                            </a>



                                                <a target="_blank" {notin name="$vo.status" value="2,3,4,5,6"}onclick="dayin()"{else/}href="{:url('console/order/update', ['id' => $vo['id'],'car_number' => $vo.car_number,'is_certification_text' => $vo.is_certification_text,'table' => 1])}"{/notin}

                                                   class="label label-success" style="margin-left: 10px;">

                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;打印提成

                                                </a>

                                            </td>

                                        </tr>

                                        {/volist}

                                        </tbody>

                                    </table>

                                    <!-- 分页 -->

                                    <div style="float: right;margin-top: -30px;">{$data->render()}</div>

                                    <button type="button" class="btn btn-success" style="margin-top: 20px;" onClick="dc()">订单数：{$total_count}单</button>

                                    <button type="button" class="btn btn-danger" style="margin-top: 20px;" onClick="dc()">销售总金额：{$total_price}元</button>

                                    <button type="button" class="btn btn-danger" style="margin-top: 20px;" onClick="dc()">订单导出</button>

                                    <!--<button type="button" class="btn btn-info" style="margin-top: 20px;" onclick="dc()">订单导出</button>-->

                                </form>

                            </div>

                        </div>

                    </div>



                </div>

            </div>



        </div>

        <!-- /page content -->

    </div>



</div>



{include file="public_foot" /}

<!--select-->

<script src="__STATIC__/js/select/select2.full.min.js"></script>

<!-- daterangepicker -->

<script src="__STATIC__/js/datepicker/daterangepicker.js"></script>

<!-- public -->

<script src="__STATIC__/js/public.js"></script>

<!-- layer -->

<script src="__STATIC__/js/layer.js"></script>

<script type="text/javascript">

    // list

    function inputpost()

    {

        var geturl = $("#geturl").val();

        window.location.href='?page='+geturl;

    }



    function dayin() {

        layer.msg('订单未支付,无法打印');

    }

    $(document).ready(function () {

        // select2

        $(".select2_single").select2({

            placeholder: "请选择分类",

            allowClear: true

        });

        $(".select2_single1").select2({

            placeholder: "请选择分类",

            allowClear: true

        });

        // interval_timer

        $('#interval_timer').daterangepicker(null,

            function(start, end, label) {

//                console.log(start.toISOString(), end.toISOString(), label);

            });

    });



    //导出excel表格

    function dc() {

        if (confirm('确认要导出订单?')) {

            var single_parent_id = "{:input('single_parent_id',0)}";

            var status = "{:input('status',0)}";
			var order_type = "1";

            var shop_id = "{:input('shop_id',0)}";

            var title = "{:input('title',0)}";

            var both = $('#interval_timer').val();

            var both_arr = both.split("/");

            var finance_order = "{:input('finance_order',0)}";

            var order_online = "{:input('order_online',0)}";

            console.log(both_arr);

            if (both_arr[0] == both_arr[1]) {

                layer.msg('请选择时间区间为同1天!');

                return;

            }

            window.location.href = "{:url('service_order/excel')}?single_parent_id=" + single_parent_id + '&interval_timer=' + both + '&status=' + status + '&shop_id=' + shop_id + '&title=' + title + '&both=' + both+'&finance_order='+finance_order+'&order_online='+order_online+'&order_type='+order_type;

        }

    }



</script>